<%--
    社团管理员账号信息界面（展示以及修改）
    Author: scm
    Date: 2023-12-12
    Version: 1.0
--%>
<%--
    需要的数据
    clubAdministrator

    传回后端的数据
    修改后的password，nickname，email，telephone，college，gender
--%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page session="true" %>
<%@ page contentType="text/html; charset=UTF-8" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="${pageContext.request.contextPath}/resources/css/bootstrap.css">
  <link rel="stylesheet" href="<c:url value="/resources/css/systemStyle.css"/>">
  <title>校园社团管理系统</title>
</head>
<body>
<!-- 顶部导航栏 -->
<jsp:include page="./header.jsp" />
<div class="content container">
  <div class="fs-4 fw-bolder ">账号信息</div>
  <div class="text-center">
    <c:if test="${!empty sessionScope.deleted}">
      <c:choose>
        <c:when test="${sessionScope.deleted}">
          <span class="text-success">修改成功!</span>
          <c:remove var="deleted" scope="session"/>
        </c:when>
        <c:otherwise>
          <span class="text-danger">修改失败</span>
          <c:remove var="deleted" scope="session"/>
        </c:otherwise>
      </c:choose>
    </c:if>
  </div>
  <div class="d-flex justify-content-center mt-4">
    <form action="<c:url value='../clubAdministrator/accountInfo' />" method="post" class="col-6">
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon1">用户名：</span>
        <input type="text" class="form-control" value="${clubAdministrator.username}" name="username" aria-label="username" aria-describedby="basic-addon1" disabled>
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon2">密码：</span>
        <input type="text" class="form-control" value="${clubAdministrator.password}" name="password" aria-label="password" aria-describedby="basic-addon2">
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon3">昵称：</span>
        <input type="text" class="form-control" value="${clubAdministrator.nickname}" name="nickname" aria-label="nickname" aria-describedby="basic-addon3">
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon9">学号：</span>
        <input type="number" class="form-control" value="${clubAdministrator.studentID}" name="studentID" aria-label="studentID" aria-describedby="basic-addon9">
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon7">性别：</span>
        <select class="form-select" name="gender" aria-label="Default select example">
          <option value="true" ${clubAdministrator.gender == true ? 'selected' : ''}>男</option>
          <option value="false" ${clubAdministrator.gender == false ? 'selected' : ''}>女</option>
        </select>
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon4">邮箱：</span>
        <input type="email" class="form-control" value="${clubAdministrator.email}" name="email" aria-label="email" aria-describedby="basic-addon4">
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon5">电话：</span>
        <input type="text" class="form-control" value="${clubAdministrator.telephone}" name="telephone" aria-label="telephone" aria-describedby="basic-addon5">
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon6">学院：</span>
        <input type="text" class="form-control" value="${clubAdministrator.college}" name="college" aria-label="college" aria-describedby="basic-addon6">
      </div>
      <div class="input-group mb-3">
        <span class="input-group-text" id="basic-addon8">注册时间：</span>
        <input type="text" class="form-control" value="<fmt:formatDate value="${clubAdministrator.createTime}" pattern="yyyy-MM-dd HH:mm:ss" />" name="createTime" aria-label="college" aria-describedby="basic-addon8" disabled>
      </div>
      <button type="submit" class="btn btn-outline-success mx-2">提交修改</button>
      <button type="reset" class="btn btn-outline-secondary">重置</button>
    </form>
  </div>
</div>
<!-- footer -->
<jsp:include page="./footer.jsp" />
<script src="<c:url value="/resources/js/bootstrap.bundle.js" />"></script>
</body>
</html>